package com.mornd.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

import com.mornd.gulimall.common.core.entity.PageEntity;
import com.mornd.gulimall.common.core.validation.UpdateGroup;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.*;

/**
 * <p>
 * 品牌
 * </p>
 *
 * @author mornd
 * @since 2023-07-23
 */
@Getter
@Setter
@TableName("pms_brand")
public class Brand extends PageEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 品牌id
     */
    @TableId(value = "brand_id", type = IdType.AUTO)
    @NotNull(message = "品牌id不能为空", groups = UpdateGroup.class)
    private Long brandId;

    /**
     * 品牌名
     */
    @NotBlank(message = "品牌名称不能为空")
    @Size(min = 0, max = 50, message = "品牌名称长度不能超过50个字符")
    private String name;

    /**
     * 品牌logo地址
     */
    private String logo;

    /**
     * 介绍
     */
    private String descript;

    /**
     * 显示状态[0-不显示；1-显示]
     */
    // ignore
    private Integer showStatus;

    /**
     * 检索首字母
     */
    @Pattern(regexp = "^[a-zA-Z]{1}$", message = "检索首字母不符合规范")
    private String firstLetter;

    /**
     * 排序
     */
    @NotNull
    @Min(0)
    private Integer sort;


}
